﻿using System;
using System.Windows.Data;
using RemoteTestRunner.Contracts;

namespace RemoteTestRunner.FormsUI.Wpf.Converters
{
    public class TestResultColumnWidthConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var typedValue = value as TestResultInfo;

            if (typedValue != null)
            {
                if (typedValue.ResultType == "DataDrivenDataRow")
                {
                    return 306;
                }
                {
                    return 325;
                }
            }

            return 325;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
